﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:p3D="clr-namespace:Perspective.Wpf3D.Shapes"
    xmlns:p3DControls="clr-namespace:Perspective.Wpf3D.Controls">

    <!--Button3D Resources-->

    <ContainerUIElement3D 
        x:Key="ButtonControl" 
        x:Shared="False">
        <ContainerUIElement3D.Transform>
            <Transform3DGroup>
                <TranslateTransform3D OffsetZ="{Binding RelativeSource={RelativeSource AncestorType={x:Type p3DControls:Button3D}}, Path=PressEffect}"/>
                <ScaleTransform3D ScaleX="0.8" ScaleY="0.5" ScaleZ="0.2"/>
                <TranslateTransform3D OffsetX="0.1" OffsetY="0.1" OffsetZ="0.01"/>
            </Transform3DGroup>
        </ContainerUIElement3D.Transform>
        <p3D:Box3D Material="{DynamicResource ControlMaterial}" />
        <p3D:Box3D Material="{DynamicResource ControlColorMaterial}" >
            <p3D:Box3D.Transform>
                <Transform3DGroup>
                    <ScaleTransform3D ScaleX="0.90" ScaleY="0.90" />
                    <TranslateTransform3D OffsetX="0.05" OffsetY="0.05" OffsetZ="0.1" />
                </Transform3DGroup>
            </p3D:Box3D.Transform>
        </p3D:Box3D>
    </ContainerUIElement3D>

    <Transform3DGroup x:Key="ButtonControlTransform" >
        <ScaleTransform3D ScaleX="0.8" ScaleY="0.5" ScaleZ="0.2"/>
        <TranslateTransform3D OffsetX="0.1" OffsetY="0.1" OffsetZ="0.01"/>
    </Transform3DGroup>

    <!--Knob3D resources-->

    <ContainerUIElement3D 
        x:Key="KnobControl" 
        x:Shared="false">
        <p3D:Bar3D SideCount="100" Material="{DynamicResource ControlMaterial}" >
            <p3D:Bar3D.Transform>
                <ScaleTransform3D ScaleZ="0.2" />
            </p3D:Bar3D.Transform>
        </p3D:Bar3D>
        <p3D:Bar3D SideCount="100" Material="{DynamicResource ControlMaterial}">
            <p3D:Bar3D.Transform>
                <Transform3DGroup>
                    <ScaleTransform3D ScaleX="0.8" ScaleY="0.8" ScaleZ="0.75" />
                    <TranslateTransform3D OffsetZ="0.2" />
                </Transform3DGroup>
            </p3D:Bar3D.Transform>
        </p3D:Bar3D>
        <p3D:Box3D Material="{DynamicResource IndicatorMaterial}">
            <p3D:Box3D.Transform>
                <Transform3DGroup>
                    <ScaleTransform3D ScaleX="0.1" ScaleY="0.5" ScaleZ="0.8"/>
                    <TranslateTransform3D OffsetY="-1.0" OffsetZ="0.2"/>
                </Transform3DGroup>
            </p3D:Box3D.Transform>
        </p3D:Box3D>
    </ContainerUIElement3D>

    <Transform3DGroup x:Key="ControlColorPartTransform" >
        <ScaleTransform3D ScaleX="0.7" ScaleY="0.7" ScaleZ="0.1" />
        <TranslateTransform3D OffsetZ="0.95" />
    </Transform3DGroup>

    <ScaleTransform3D x:Key="KnobControlTransform"
        ScaleX="0.5" ScaleY="0.5" ScaleZ="0.5" />

    <!--Fader3D resources-->

    <ScaleTransform3D x:Key="FaderGlobalTransform" ScaleX="1.6" ScaleY="1.6" ScaleZ="1.6"/>
    
    <ContainerUIElement3D 
        x:Key="FaderFront" 
        x:Shared="false">
        <p3D:Square3D 
            Material="{DynamicResource FrontMaterial}">
            <p3D:Square3D.Transform>
                <Transform3DGroup>
                    <ScaleTransform3D ScaleX="0.3125" ScaleY="1.25" />
                </Transform3DGroup>
            </p3D:Square3D.Transform>
        </p3D:Square3D>
        <!--Fader track-->
        <p3D:Box3D 
            Material="{DynamicResource FaderTrackMaterial}">
            <p3D:Box3D.Transform>
                <Transform3DGroup>
                    <ScaleTransform3D ScaleX="0.03" ScaleY="1.0" ScaleZ="0.01" />
                    <TranslateTransform3D OffsetX="0.14125" OffsetY="0.125" />
                </Transform3DGroup>
            </p3D:Box3D.Transform>
        </p3D:Box3D>
    </ContainerUIElement3D>

    <ContainerUIElement3D 
        x:Key="FaderThumbControl"
        x:Shared="false">
        <p3D:Box3D Material="{DynamicResource ControlColorMaterial}" />
        <p3D:Box3D Material="{DynamicResource IndicatorMaterial}" >
            <p3D:Box3D.Transform>
                <TranslateTransform3D OffsetY="1.0" />
            </p3D:Box3D.Transform>
        </p3D:Box3D>
        <p3D:Box3D Material="{DynamicResource ControlColorMaterial}" >
            <p3D:Box3D.Transform>
                <TranslateTransform3D OffsetY="2.0" />
            </p3D:Box3D.Transform>
        </p3D:Box3D>
    </ContainerUIElement3D>
    
    <Transform3DGroup x:Key="FaderControlTransform">
        <TranslateTransform3D OffsetX="-0.5" OffsetY="-0.5"/>
        <ScaleTransform3D ScaleX="0.2" ScaleY="0.02" ScaleZ="0.1"/>
        <TranslateTransform3D OffsetX="0.15625" OffsetY="0.125" />
        <!--<ScaleTransform3D ScaleX="0.1" ScaleY="0.1" ScaleZ="0.1"/>
        <TranslateTransform3D OffsetX="0.15625" OffsetY="0.125" OffsetZ="0.1"/>-->
    </Transform3DGroup>

    <Transform3DGroup x:Key="SphericalFaderControlTransform">
        <ScaleTransform3D ScaleX="0.1" ScaleY="0.1" ScaleZ="0.1"/>
        <TranslateTransform3D OffsetX="0.15625" OffsetY="0.125" OffsetZ="0.1"/>
    </Transform3DGroup>

    <!--Gyroscope3D Resources-->

    <AxisAngleRotation3D x:Key="RotationX90Transform" Axis="1.0, 0.0, 0.0" Angle="90.0" />

</ResourceDictionary>